package work;

/**
 * @TODO
 * @Author xu
 * 2025/2/24
 */
import java.util.Scanner;
public class Day3_3 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入要打印的金字塔行数：");
        int n = scanner.nextInt();
        System.out.println();
        printLetterPyramid(n);

    }
    private static void printLetterPyramid(int n) {
        for (int i = 0; i < n; i++) {
            for (int j = n; j > i + 1; j--) {
                System.out.print(" ");
            }
            char letter = (char) ('A' + i);
            for (int k = 0; k < (2 * i + 1); k++) {
                System.out.print(letter);
            }
            System.out.println();
        }
    }


}
